package com.scoring.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.scoring.system.mapper.ClassesMapper;
import com.scoring.system.pojo.Classes;
import com.scoring.system.service.ClassesService;
@Service("classesService")
public class ClassesServiceImpl implements ClassesService {
	
	@Resource
	private ClassesMapper classDao;

	@Override
	public int softDelete(int id) {
		return classDao.softDelete(id);
	}

	@Override
	public int saveClass(Classes record) {
		return classDao.insert(record);
	}

	@Override
	public Classes getClassById(int id) {
		return classDao.selectByPrimaryKey(id);
	}

	@Override
	public Classes getClassByName(String name) {
		return classDao.selectByName(name);
	}

	@Override
	public List<Classes> listClassByMajorId(int majorId) {
		return classDao.listClassesByMajorId(majorId);
	}

	@Override
	public List<Classes> listClassByUserId(int userId) {
		return classDao.listClassesByUserId(userId);
	}

	@Override
	public int updateClass(Classes record) {
		return classDao.updateByPrimaryKey(record);
	}

	@Override
	public Classes getClassByCode(String code) {
		return classDao.selectByCode(code);
	}

}
